﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Wazzup.Engine.Utility
{
    public static class TimeHelper
    {
        public static long GetUnixTimestamp(DateTime value)
        {
            TimeSpan span = (value - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc));
            return (long)span.TotalSeconds;
        }

        public static long GetNowUnixTimestamp()
        {
            return GetUnixTimestamp(DateTime.UtcNow);
        }
    }
}
